package com.huanxing.cloud.miniapp.controller.app;

import com.huanxing.cloud.common.core.util.Result;
import com.huanxing.cloud.common.security.annotation.HxInner;
import com.huanxing.cloud.miniapp.service.IWxAppService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 微信应用
 *
 * @author lijx
 * @since 2022/3/14 15:36
 */
@Slf4j
@AllArgsConstructor
@RestController
@RequestMapping("/app/wxapp")
@Tag(description = "app-wxapp", name = "微信应用-API")
public class AppWxAppController {

	private final IWxAppService wxAppService;

	@HxInner
	@Operation(summary = "通过id查询微信应用")
	@GetMapping("/inner/{appId}")
	public Result getInnerById(@PathVariable("appId") String appId) {
		return Result.success(wxAppService.findByAppId(appId));
	}

}
